package _09define._04houmework;

public class Account {
    private String userName;
    private String password;
    private double balance;

    public void setUserName(String userName) {
        if (userName.length()>=4&&userName.length()<=6) {
            this.userName = userName;
        }
        else throw new IllegalArgumentException("用户名长度必须在4到6之间");
    }

    public void setPassword(String password) {
        if (password.length()==6) {
            this.password = password;
        }
        else throw new IllegalArgumentException("密码长度必须为6位");
    }

    public void setBalance(double balance) {
        if (balance >100) {
            this.balance = balance;
        }
        else throw new IllegalArgumentException("余额必须大于100");
    }

    public String getUserName() {
            return userName;
    }

    public String getPassword() {
        return password;
    }

    public double getBalance() {
        return balance;
    }
}
